//
//  MZY_EX_evaliuationCell.m
//  FullHouse
//
//  Created by dllo on 16/1/28.
//  Copyright © 2016年 yy. All rights reserved.
//

#import "MZY_EX_evaliuationCell.h"

#define WIDTH self.contentView.frame.size.width
#define HEIGHT self.contentView.frame.size.height
#define HORIZONTAL [UIScreen mainScreen].bounds.size.width / 414
#define VERTICAL [UIScreen mainScreen].bounds.size.height / 736

@implementation MZY_EX_evaliuationCell

- (void)dealloc
{
    [self.commentCountLabel release];
    [self.faceImageView release];
    [self.nameLabel release];
    [self.attitudeLabel release];
    [self.attitudeDetailLabel release];
    [self.timeLabel release];
    [self.timeDetailLabel release];
    [self.qualityLabel release];
    [self.qualityDetailLabel release];
    [self.priceLabel release];
    [self.priceDetailLabel release];
    [self.commentLabel release];
    [self.placeLabel release];
    [self.realLabel release];
    [super dealloc];
}

- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        [self createView];
    }
    return self;
}

- (void)createView{
    self.commentCountLabel = [[UILabel alloc]init];
    [self.contentView addSubview:self.commentCountLabel];
    [self.commentCountLabel release];
    
    self.faceImageView = [[UIImageView alloc]init];
    [self.contentView addSubview:self.faceImageView];
    [self.faceImageView release];
    
    self.nameLabel = [[UILabel alloc]init];
    [self.contentView addSubview:self.nameLabel];
    [self.nameLabel release];
    
    self.attitudeLabel = [[UILabel alloc]init];
    [self.contentView addSubview:self.attitudeLabel];
    [self.attitudeLabel release];
    
    self.attitudeDetailLabel = [[UILabel alloc]init];
    [self.contentView addSubview:self.attitudeDetailLabel];
    [self.attitudeDetailLabel release];
    
    self.timeLabel = [[UILabel alloc]init];
    [self.contentView addSubview:self.timeLabel];
    [self.timeLabel release];
    
    self.timeDetailLabel = [[UILabel alloc]init];
    [self.contentView addSubview:self.timeDetailLabel];
    [self.timeDetailLabel release];
    
    self.qualityLabel  = [[UILabel alloc]init];
    [self.contentView addSubview:self.qualityLabel];
    [self.qualityLabel release];
    
    self.qualityDetailLabel = [[UILabel alloc]init];
    [self.contentView addSubview:self.qualityDetailLabel];
    [self.qualityDetailLabel release];
    
    self.priceLabel = [[UILabel alloc]init];
    [self.contentView addSubview:self.priceLabel];
    [self.priceLabel release];
    
    self.priceDetailLabel = [[UILabel alloc]init];
    [self.contentView addSubview:self.priceDetailLabel];
    [self.priceDetailLabel release];
    
    self.commentLabel = [[UILabel alloc]init];
    [self.contentView addSubview:self.commentLabel];
    [self.commentLabel release];
    
    self.placeLabel = [[UILabel alloc]init];
    self.placeLabel.backgroundColor = [UIColor lightGrayColor];
    [self.contentView addSubview:self.placeLabel];
    [self.placeLabel release];
    
    self.rightImageView = [[UIImageView alloc]init];
    [self.contentView addSubview:self.rightImageView];
    [self.rightImageView release];
    
    self.realLabel = [[UILabel alloc]init];
    [self.contentView addSubview:self.realLabel];
    [self.realLabel release];
}

- (void)layoutSubviews{
    [super layoutSubviews];
    self.commentCountLabel.frame = CGRectMake(0, 10 * VERTICAL, WIDTH, 20 * VERTICAL);
    self.faceImageView.frame = CGRectMake(10 * HORIZONTAL, 50 * VERTICAL, 30 * HORIZONTAL, 30 * HORIZONTAL);
    self.nameLabel.frame = CGRectMake(60 * HORIZONTAL, 60 * VERTICAL, 150 * HORIZONTAL, 20 * VERTICAL);
    self.attitudeLabel.frame = CGRectMake(10 * HORIZONTAL, 100 * VERTICAL, 70, 20 * VERTICAL);
    self.attitudeDetailLabel.frame = CGRectMake(110 * HORIZONTAL, 100 * VERTICAL, 30, 20 * VERTICAL);
    self.qualityLabel.frame = CGRectMake(260 * HORIZONTAL, 100 * VERTICAL, 70, 20 * VERTICAL);
    self.qualityDetailLabel.frame = CGRectMake(360 * HORIZONTAL, 100 * VERTICAL, 30, 20 * VERTICAL);
    self.timeLabel.frame = CGRectMake(10 * HORIZONTAL, 140 * VERTICAL, 70, 20 * VERTICAL);
    self.timeDetailLabel.frame = CGRectMake(110 * HORIZONTAL, 140 * VERTICAL, 30, 20 * VERTICAL);
    self.priceLabel.frame = CGRectMake(260 * HORIZONTAL, 140 * VERTICAL, 70, 20 * VERTICAL);
    self.priceDetailLabel.frame = CGRectMake(360 * HORIZONTAL, 140 * VERTICAL, 30, 20 * VERTICAL);
    self.commentLabel.frame = CGRectMake(10 * HORIZONTAL, 180 * VERTICAL, WIDTH - 20 * HORIZONTAL, 50);
    self.placeLabel.frame = CGRectMake(10 * HORIZONTAL, 250 * HORIZONTAL, WIDTH - 20 * HORIZONTAL, 40 * VERTICAL);
    self.rightImageView.frame = CGRectMake(10 * HORIZONTAL, 310 * HORIZONTAL, 20, 20);
    self.realLabel.frame = CGRectMake(40 * HORIZONTAL, 310 * HORIZONTAL, 300, 20);
}

@end
